﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DB_QLSV;
using DB_QLSV.BusinessClassLibrary;
namespace GUI_QLSV
{
    public partial class frmThemMonHoc : Form
    {
        public frmThemMonHoc()
        {
            InitializeComponent();
        }

        private void frmThemMonHoc_Load(object sender, EventArgs e)
        {
            List<Nganh> nganhList = NganhBUS.LayDanhSach();
            foreach (Nganh item in nganhList)
            {
                cbbNganh.Items.Add(item);
            }
            cbbNganh.DisplayMember = "tennganh";
            cbbNganh.ValueMember = "masonganh";
            //TreeNode node = GUI_QLSV.KhoaHoc.selectedNodeInBranch;
            Nganh branchObject = (Nganh)GUI_QLSV.KhoaHoc.selectedNodeInBranch.Tag;
            cbbNganh.Text = branchObject.tennganh;
        }

        private void bttAdd_Click(object sender, EventArgs e)
        {
           
        }

        private void cbbNganh_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbbLop.Items.Clear();
            Nganh branch = (Nganh)cbbNganh.SelectedItem;
            List<StudentManagement.DataGVClassObject> classList = LopBUS.LayDanhSach(branch);
            foreach (StudentManagement.DataGVClassObject item in classList)
            {
                cbbLop.Items.Add(item);
            }
            cbbLop.DisplayMember = "tenlop";
            cbbLop.ValueMember = "malop";
            cbbLop.SelectedIndex = 0;
        }

        private void cbbNganh_Click(object sender, EventArgs e)
        {
           
        }
    }
}
